<template>
  <div>
     <!-- banner -->
    <div class="category-banner banner">
      <h1 class="banner-title">相册</h1>
    </div>
    <!-- 分类列表 -->
    <v-card class="blog-container">
      <Card :imgList="imgList"/>
    </v-card>

 
  </div> 
</template>
<script>
import {list} from '../../api/photo';
import Card from '../../components/Card.vue'

export default {
  
    data() {
    return {
      imgList:[]
    };
  },
  components:{
    Card
  },
  created(){
    this.getImgList();
  },
  methods: {
    getImgList(){
      list().then(res=>{
        if(res.data.code==200){
          this.imgList=res.data.data;
        }
      })
    }
  }
}
</script>
<style scoped>
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-image: radial-gradient(circle, #fff 30%, #ccc);
  padding: 0 40px;
  font-family: "Source Sans Pro", Helvetica, sans-serif;
  font-weight: 300;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 200px);
  grid-column-gap: 30px;
  grid-row-gap: 30px;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-left: 10.5%;
  max-width: 700px;
}
.grid .card {
  background-color: #ccc;
  width: 200px;
  height: 150px;
  transition: all 0.1s ease;
  border-radius: 3px;
  position: relative;
  z-index: 1;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0);
  overflow: hidden;
  cursor: pointer;
}
.grid .card:hover {
  -webkit-transform: scale(2);
          transform: scale(2);
  z-index: 2;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
}
.grid .card:hover img {
  -webkit-filter: grayscale(0);
          filter: grayscale(0);
}
.grid .card .reflection {
  position: absolute;
  width: 100%;
  height: 100%;
  z-index: 2;
  left: 0;
  top: 0;
  transition: all 0.1s ease;
  opacity: 0;
  mix-blend-mode: soft-light;
}
.grid .card img {
  width: 100%;
  height: 100%;
  -o-object-fit: cover;
     object-fit: cover;
  -webkit-filter: grayscale(0.65);
          filter: grayscale(0.65);
  transition: all 0.5s ease;
}
</style>
<style lang="scss">
.category-banner {
  background: url(http://www.lsc-it.cn/%E7%9B%B8%E5%86%8C.jpg) center
    center / cover no-repeat;
  background-color: #49b1f5;
}
.category-title {
  text-align: center;
  font-size: 36px;
  line-height: 2;
}
@media (max-width: 759px) {
  .category-title {
    font-size: 28px;
  }
}
.category-list {
  margin: 0 1.8rem;
  list-style: none;
}
.category-list-item {
  padding: 8px 1.8rem 8px 0;
}
.category-list-item:before {
  display: inline-block;
  position: relative;
  left: -0.75rem;
  width: 12px;
  height: 12px;
  border: 0.2rem solid #49b1f5;
  border-radius: 50%;
  background: #fff;
  content: "";
  transition-duration: 0.3s;
}
.category-list-item:hover:before {
  border: 0.2rem solid #ff7242;
}
.category-list-item a:hover {
  transition: all 0.3s;
  color: #8e8cd8;
}
.category-list-item a:not(:hover) {
  transition: all 0.3s;
}
.category-count {
  margin-left: 0.5rem;
  font-size: 0.75rem;
  color: #858585;
}
</style>